/** @format */

import axios from '@/utils/request';

// 盘点记录分页查询
export function pageList(params) {
  return axios.get('/rfid/inventoryBill/page', { params: params });
}

// 通过ID查询详情
export function getInfo(billNumber) {
  return axios.get('/rfid/inventoryBill/queryOne', { params: {billNumber: billNumber} });
}

// 新增盘点表单
export function add(data) {
  return axios.post('/rfid/inventoryBill/add', data, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

// 编辑盘点表单
export function update(data) {
  return axios.put('/rfid/inventoryBill/edit', data);
}

// 盘点详情列表查询
export function detailsList(params) {
  return axios.get('/rfid/inventoryBill/detailsList', { params: params });
}

// 盘点表单 删除
export function del(billNumber) {
  return axios.delete('/rfid/inventoryBill/del', { params: { billNumber: billNumber } });
}

// 密集架盘点
export function mjjInventory(data) {
  return axios.post('/rfid/inventoryBill/mjjInventory', data, {
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

// 手动盘点导出
export function exportExcel(billNumber) {
  return axios.get('/rfid/inventoryBill/export',
      {
        params: { billNumber: billNumber },
        responseType: 'blob'
      });
}

// 手动盘点导入
export function importData(data) {
  return axios.post('/rfid/inventoryBill/import', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}
